package com.itheima.server.imp;



import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageSerializable;
import com.itheima.mapper.NursingProjectMapper;
import com.itheima.pojo.NursingPage;
import com.itheima.pojo.NursingProject;
import com.itheima.pojo.PageResult;
import com.itheima.server.NursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
@Service
public class NursingProjectServiceImpl extends ServiceImpl<NursingProjectMapper, NursingProject> implements NursingProjectService {
@Autowired
private NursingProjectMapper nursingProjectMapper;
    @Override
    public PageResult<NursingProject> getlist(NursingPage nursingPage) {
        PageHelper.startPage(nursingPage.getPage(),nursingPage.getPageSize());
        List<NursingProject> List = nursingProjectMapper.getlist(nursingPage);
        Page<NursingProject> p = (Page<NursingProject>) List;
        return new PageResult<>(p.getTotal(), List);
    }

    @Override
    public List<NursingProject> getAll() {
        return nursingProjectMapper.getAll();
    }
}
